package com.wuxx.quartz.model;

/**
 *
 * 定时类型触发器类型
 * @date 2022/06/08 10:03
 * @author wuxx
 */

public enum TriggerType {
    CRON("标准CRON支持"),
    INTERVAL_MILLISECOND("固定间隔毫秒"),
    INTERVAL_SECOND("固定间隔秒"),
    INTERVAL_MINUTE("固定间隔分钟"),
    INTERVAL_HOUR("固定间隔小时")
    ;


    private String describe;

    TriggerType(String describe) {
        this.describe = describe;
    }

    public static TriggerType getTriggerTypeByName(String name){
        if(INTERVAL_MILLISECOND.name().equals(name)) return INTERVAL_MILLISECOND;
        if(INTERVAL_SECOND.name().equals(name)) return INTERVAL_SECOND;
        if(INTERVAL_HOUR.name().equals(name)) return INTERVAL_HOUR;
        return INTERVAL_MINUTE;
    }
}
